import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import goods from '@/views/goods'
import show from '@/views/Show'
// import play from '@/views/play.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/show',
    children: [
      {
        path: '/goods',
        name: 'goods',
        component: goods
      },
      {
        path: '/play',
        name: 'play',
        // component: play
        component: () => import('@/views/play')
      },
      // 登录页路由
      {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login')
      }
    ]
  },
  {
    path: '/payment', // 付款页面
    name: 'payment',
    component: () => import('@/components/payment.vue')
  },
  {
    path: '/show',
    name: 'show',
    component: show
  }
]

const router = new VueRouter({
  routes
})

export default router
